//Object "Instruction"

#include "out_Instruction.h"
#include "out_Memoire.h"

using namespace std;

//constructors :

Instruction::Instruction(){
	m_operation=0;	//DAT
	m_adressageA=0;	
	m_adressageB=0;
	m_argA=0;
	m_argB=0;
}

Instruction::Instruction(unsigned char operation, unsigned char adressageA, unsigned char adressageB, short argA, short argB){
	m_operation=operation;
	m_adressageA=adressageA;
	m_adressageB=adressageB;
	m_argA=argA%TAILLE_MEM;
	m_argB=argB%TAILLE_MEM;
}

//functions :

void Instruction::printInstr(){
	printf("memoire : %d %d %d %d %d\n", m_operation, m_adressageA, m_argA, m_adressageB, m_argB);
}


//accessors

uchar Instruction::getOp(){ return m_operation; }
uchar Instruction::getAdrA(){ return m_adressageA; }
uchar Instruction::getAdrB(){ return m_adressageB; }
short Instruction::getArgA(){ return m_argA; }
short Instruction::getArgB(){ return m_argB; }

void Instruction::setOp(uchar op){ m_operation=op; }
void Instruction::setAdrA(uchar a){ m_adressageA=a; }
void Instruction::setAdrB(uchar b){ m_adressageB=b; }
void Instruction::setArgA(short a){ m_argA=a%TAILLE_MEM; }
void Instruction::setArgB(short b){ m_argB=b%TAILLE_MEM; }


//destructors :
Instruction::~Instruction(){}

//functions
void Instruction::raz(){	//store DAT 0
	m_operation=0;	//dat
	m_adressageA=0;
	m_adressageB=0;
	m_argA=0;
	m_argB=0;
}


